import { configInterface } from '@/interface/configInterface';
const configDev: configInterface = {
  noAuthUrls: [
    '/swagger/',
    '/swagger/swagger-ui.css',
    '/swagger/swagger-ui-bundle.js',
    '/swagger/swagger-ui-standalone-preset.js',
    '/swagger/swagger-ui-init.js',
    '/swagger/favicon-32x32.png',
    '/api/admin/user/list',
    '/favicom.ico',
  ],
  corsOptions: {
    origin: '*',
    methods: 'GET,HEAD,PUT,PATCH,POST,DELETE',
    preflightContinue: false,
    optionsSuccessStatus: 204, // some legacy browsers (IE11, various SmartTVs) choke on 204
  },
  rate_limit: {
    windowMs: 15 * 60 * 1000, // 15 minutes
    max: 100, // limit each IP to 100 requests per windowMs},
  },
  jwt: {
    secret: 'angjing213',
    expire: "1h",
    alg: 'HS256',
    issuer: 'wangjing',
  },
  port: 3000,
  loggerLevel: ['error', 'warn', 'log'],
  globalPrefix: 'v1/api',
  noAuthURL: [
    '/swagger/',
    '/swagger/swagger-ui.css',
    '/swagger/swagger-ui-bundle.js',
    '/swagger/swagger-ui-standalone-preset.js',
    '/swagger/swagger-ui-init.js',
    '/swagger/favicon-32x32.png',
    '/favicom.ico',
  ],
  page: {
    pageSize: 5,
    pageNumber: 1,
  },

  fileConf: {
    size: 1024 * 1024 * 10,
    allowMintType: [
      // 如果有知识付费，感觉这里要支持 pdf word ? GZIP 这些？
      'text/plan',
      'image/jpeg',
      'image/png',
      'image/jpg',
      'image/gif',
      'video/mp4',
    ],
  },

  typeOrm: {
    type: 'mysql',
    host: 'localhost',
    port: 3306,
    username: 'root',
    password: 'wangjing123',
    database: 'nestjs2',
    synchronize: true,
    autoLoadEntities: true,
    logging: ['error'],
  },
  Qiniu: {
    accessKey: 'YtrfQssYto5jFTiLvrhr4hUlQ4mB6gcdFzJSk8j-',
    secretKey: 'sTntqgpEg6CbGm4wmA-JDFl2WRSPoNlDyl24RsQB',
    bucket: 'nestjs18381532620',
    url: 'http://pic2.wineforyou.cn/',
  },
  swagger: true,
};

export { configDev };
